<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:89:"E:\phpStudy20161103\WWW\tpAdmin-master\public/../application/admin\view\sales\assign.html";i:1491377374;s:90:"E:\phpStudy20161103\WWW\tpAdmin-master\public/../application/admin\view\template\base.html";i:1488899632;s:101:"E:\phpStudy20161103\WWW\tpAdmin-master\public/../application/admin\view\template\javascript_vars.html";i:1488899632;}*/ ?>
﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title><?php echo \think\Config::get('site.title'); ?></title>
    <link rel="Bookmark" href="__ROOT__/favicon.ico" >
    <link rel="Shortcut Icon" href="__ROOT__/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="__LIB__/html5.js"></script>
    <script type="text/javascript" src="__LIB__/respond.min.js"></script>
    <script type="text/javascript" src="__LIB__/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="__STATIC__/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="__LIB__/Hui-iconfont/1.0.7/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="__LIB__/icheck/icheck.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/app.css"/>
    <link rel="stylesheet" type="text/css" href="__LIB__/icheck/icheck.css"/>
    
    <!--[if IE 6]>
    <script type="text/javascript" src="__LIB__/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!--定义JavaScript常量-->
<script>
    window.THINK_ROOT = '<?php echo \think\Request::instance()->root(); ?>';
    window.THINK_MODULE = '<?php echo \think\Url::build("/" . \think\Request::instance()->module(), "", false); ?>';
    window.THINK_CONTROLLER = '<?php echo \think\Url::build("___", "", false); ?>'.replace('/___', '');
</script>
</head>
<body>

<nav class="breadcrumb">
    <div id="nav-title"></div>
    <a class="btn btn-success radius r btn-refresh" style="line-height:1.6em;margin-top:3px" href="javascript:;" title="刷新"><i class="Hui-iconfont"></i></a>
</nav>


<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="<?php echo \think\Request::instance()->baseUrl(); ?>">
        <input type="hidden" name="id" value="<?php echo isset($vo['id']) ? $vo['id'] :  ''; ?>">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>批次号：</label>
            <div class="formControls col-xs-6 col-sm-3">
                <select  class="input-text" id="batch" placeholder="批次号" name="batch" value="<?php echo isset($batch) ? $batch :  ''; ?>" datatype="*" nullmsg="请选择批次号">
                    <option value="">请选择</option>
                    <?php if(is_array($arr_batch) || $arr_batch instanceof \think\Collection || $arr_batch instanceof \think\Paginator): $i = 0; $__LIST__ = $arr_batch;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                    <option class="text-c" value="<?php echo $vo['batch']; ?>">
                        <?php echo $vo['batch']; ?>
                    </option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>优惠码段：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="number" class="input-text start_num" placeholder="起始号码" name="start_num" value="" readonly/> --
                <input type="number" class="input-text end_num" placeholder="结束号码" name="end_num" value="" readonly/>
                剩余<span class="number_plus" style="color: red;"> * </span>张
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">分配卡数：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="number" class="input-text num" placeholder="数量" name="num" value="" datatype="*" nullmsg="请输入分配卡数"> 张
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">备注：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <textarea class="textarea" placeholder="" name="remark" onKeyUp="textarealength(this,100)"><?php echo isset($vo['remark']) ? $vo['remark'] :  ''; ?></textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius" >&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript" src="__LIB__/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__LIB__/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__STATIC__/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="__STATIC__/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/app.js"></script>
<script type="text/javascript" src="__LIB__/icheck/jquery.icheck.min.js"></script>

<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script>
    $(function () {

        $("[name='company_type'][value='<?php echo isset($vo['company_type']) ? $vo['company_type'] :  ''; ?>']").prop("checked", true);
        $("[name='offline_type'][value='<?php echo isset($vo['offline_type']) ? $vo['offline_type'] :  ''; ?>']").prop("checked", true);

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });


        //优惠码号段失焦时 判断是否为空 显示提示信息
//        $('.start_num').blur(function(){
//            var start_num = $(this).val();
//            if(start_num == ''){
//                $('.num').removeClass('col-xs-3 col-sm-3').addClass('Validform_checktip Validform_wrong').empty().html('请输入优惠码号段');
//            }else{
//                $('.num').removeClass('Validform_checktip Validform_wrong').addClass('col-xs-3 col-sm-3').empty();
//            }
//        });
//        $('.end_num').blur(function(){
//            var end_num = $(this).val();
//            if(end_num == ''){
//                $('.num').removeClass('col-xs-3 col-sm-3').addClass('Validform_checktip Validform_wrong').empty().html('请输入优惠码号段');
//            }else{
//                $('.num').removeClass('Validform_checktip Validform_wrong').addClass('col-xs-3 col-sm-3').empty();
//            }
//        });

        //选择批次号后 将该批次号传入后台
        $('#batch').change(function(){
            var batch = $(this).val();
            $.ajax({
                url:'/admin/Sales/number',
                type:'post',
                dataType:'json',
                data:{batch:batch},
                success:function(number_min){
                    $('.start_num').val(number_min.number_min);
                    $('.end_num').val(number_min.number_max);
                    $('.number_plus').html(' '+number_min.number_plus+' ');
                }
            })
        });

    })
</script>

</body>
</html>